<template>
	<view class="content">
		<view class="box">
			<!-- 头部信息 -->
			<view class="box-top" @click="gotoGroupUser">
				<view class="top-left">
					<text>家族成员</text>
				</view>
				<view class="top-right">
					<view class="num">
						<text>共{{num}}人</text>
					</view>
					<view class="goSet">
						<image :src="goSet"></image>
					</view>
				</view>
			</view>
			<!-- 成员信息 -->
			<view class="box-bottom">
				<view class="con">
					<view class="con-img" @click="addUser">
						<image :src="addImg"></image>
					</view>
					<view class="con-text">
						<text>邀请好友</text>
					</view>
				</view>
				<block v-for="(item,index) in userList" :key="index">
					<view class="con">
						<view class="con-img">
							<image :src="item.head"></image>
						</view>
						<view class="con-text">
							<text>{{item.nickname}}</text>
						</view>
					</view>
				</block>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		props: ['userList', 'num', 'chatObject'],
		data() {
			return {
				addImg: require('@/static/img/msg/set/01.svg'),
				goSet: require('@/static/img/main/my/userinfo/01.svg'),
			}
		},
		methods: {
			addUser() {
				//跳转拉取好友进入群聊页面
				uni.navigateTo({
					url: '/subpkg/msg/set/set-group/set-group-add-user/set-group-add-user?groupData=' + JSON
						.stringify(this
							.chatObject)
				})
			},
			//跳转家族成员页面
			gotoGroupUser() {
				uni.navigateTo({
					url: '/subpkg/msg/set/set-group/set-group-user/set-group-user?groupData=' + JSON
						.stringify(this
							.chatObject)
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.content {
		width: 100%;
		background-color: #ffffff;
		margin-bottom: 20rpx;
	}

	.box {
		width: 94%;
		margin-left: 3%;

		.box-top {
			display: flex;
			justify-content: space-between;
			line-height: 50rpx;

			.top-left {
				width: 80%;

				text {
					color: rgba(56, 56, 56, 1);
					font-size: 32rpx;
					font-weight: 400;
				}
			}

			.top-right {
				display: flex;
				justify-content: space-between;

				.num {
					text {
						color: rgba(166, 166, 166, 1);
						font-size: 20rpx;
						font-weight: 400;
					}
				}

				.goSet {
					image {
						width: 50rpx;
						height: 50rpx;
					}
				}
			}
		}

		.box-bottom {
			display: flex;
			padding: 10rpx 0;

			.con {
				width: 20%;

				.con-img {
					text-align: center;

					image {
						width: 100rpx;
						height: 100rpx;
						border-radius: 50%;
					}
				}

				.con-text {
					text-align: center;

					text {
						color: rgba(166, 166, 166, 1);
						font-size: 20rpx;
						font-weight: 500;
					}
				}

			}
		}
	}



	text {
		display: -webkit-box;
		/** 对象作为伸缩盒子模型显示 **/
		overflow: hidden;
		word-break: break-all;
		/* break-all(允许在单词内换行。) https://www.w3school.com.cn/cssref/pr_word-break.asp*/
		text-overflow: ellipsis;
		/* 超出部分省略号 */
		-webkit-box-orient: vertical;
		/** 设置或检索伸缩盒对象的子元素的排列方式 **/
		-webkit-line-clamp: 1;
		/** 显示的行数 **/
	}
</style>